#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
#include <list>

int main() {
	//n个顶点，m条边
	int n, m;
	scanf("%d %d", &n, &m);

	//图（题目里节点从1开始，所以n+1）（我们希望节点直接对应索引）
	std::vector<std::vector<int>> graph(n + 1, std::vector<int>());
	//入度表
	std::vector<int> indegree(n + 1, 0);

	for (int i = 0; i < m; i++) {
		int x, y;
		scanf("%d %d", &x, &y);
		//一条有向边
		graph[x].push_back(y);
		//x->y,y入度+1
		indegree[y]++;
	}

	std::list<int> q;
	for (int i = 1; i < n + 1; i++) {
		//入度为0的进队列
		if (indegree[i] == 0) {
			q.push_back(i);
		}
	}

	std::vector<int> ans;
	while (!q.empty()) {
		int cur = q.front();
		//出队，收集结果
		ans.push_back(cur);
		q.pop_front();

		for (int i = 0; i < graph[cur].size(); i++) {
			//我的邻居入度--
			int next = graph[cur][i];
			//要是变成0了，进队列
			if (--indegree[next] == 0) {
				q.push_back(next);
			}
		}
	}

	//为什么要有这个判断
	if (ans.size() == n) {
		for (int i = 0; i < ans.size(); i++) {
			printf("%d ", ans[i]);
		}
	}
	else {
		printf("yes");
	}


	return 0;
}